﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZhaJinHua.Data.Entities
{
    public class GroupInfo
    {
        public GroupInfo()
        {
            this.Users=new List<UserInfo>();
        }
        public int Id { get; set; }

        public List<UserInfo> Users { get;private set; }

        public bool AddUser(UserInfo user)
        {
            this.Users.Add(user);
            return true;
        }

        public bool HasUser(string realName)
        {
            return this.Users.Count(x => string.Equals(x.RealName, realName,StringComparison.CurrentCultureIgnoreCase)) > 0;
        }
    }
}
